import React from 'react';
import { Input } from 'antd';

const { TextArea } = Input;

const Index = (props) => {
  const {
    autoSize = { minRows: 3 }, // 	自适应内容高度，可设置为 true|false 或对象：{ minRows: 2, maxRows: 6 }

    disabled,
    value,

    ...rest
  } = props;

  if (!Object.keys(props).includes('value')) {
    return 'DEPRECATED';
  }

  if (disabled && disabled.render) {
    return disabled.render(value, { value }) || <span>&nbsp;</span>;
  }

  return <TextArea autoSize={autoSize} {...rest} disabled={!!disabled} value={value} />;
};

Index.displayName = 'TextArea';
export default Index;
